home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 029a / xeq131.zip / XEQ.DOC < prev   
Text File  |  1991-06-05  |  14KB  |  324 lines

  1. comment *
  2.                    XEQ
  3.                -----
  4.        XEQ - COM File Library and Command Executor
  5.  
  6. This program allows COM files to be stored inside XEQ's code and executed
  7. by the command:
  8.     XEQ command
  9. For example, if BEEP.COM has been added to XEQ then:
  10.     XEQ BEEP
  11. will execute the BEEP program stored inside XEQ. The original BEEP.COM
  12. can be removed from the hard disk (onto a backup floppy!!!). If the
  13. specified command is not in XEQ it is passed to the DOS for execution as
  14. if directly typed at the DOS prompt.
  15.  
  16. PURPOSE
  17.     The purpose is to prevent wasted hard-disk space by those pesky
  18. little COM files we don't seem to be able to do without. When hard disks
  19. are formatted they are given an allocation size (called a cluster size)
  20. and this is typically 2048 or 4096 bytes. So when you save a 7 byte
  21. COM file like BEEP.COM, it takes up a full cluster. By combining these
  22. COM files into this program or LIBRARY, several COM files can be stored
  23. in one file (the XEQ program itself) and still be accessed without this waste
  24. in hard disk space.
  25.  
  26. In order to make the body of XEQ as small as possible, only a limited
  27. number of options are available. They are
  28.  
  29.     XEQ [/R]<command> Execute <command> if it is in the library
  30.                 or passes it to DOS for execution if not
  31.     XEQ /A<command>   Add <command>.COM to library if not existent
  32.     XEQ /D<command>   Delete command from library if existent
  33.     XEQ /E<command>   Extract command from library to .COM file if existent
  34.     XEQ /L          List the <commands> in the library
  35.     XEQ /H          Display HELP information
  36.     XEQ           Attempt to run internal AUTOXEQ.COM, else HELP
  37.     XEQ /P<parms>      As above but passed <parms> to AUTOXEQ.COM
  38.     XEQ /C<command>      Suppress the reprocessing of the command line
  39.  
  40. COMMAND DETAILS
  41.  
  42. /R - run a command
  43.  
  44. If no switch is given, the /R is assumed. If the given command name
  45. is in the library it is executed directly from there. XEQ internally
  46. relocates the stored file in memory so that the memory image is
  47. identical to the image if it had been loaded from the COM file on
  48. disk. This includes the way DOS loaded a COM file and the pretests
  49. for argument suitability and register set up. Thus ALL COM files
  50. should execute normally when run from within XEQ.
  51.  
  52. If the command is not found in XEQ then the string is passed to a DOS
  53. shell for execution. A second copy of COMMAND.COM is spawned with the
  54. command added after the /C switch. Therefore the command can be an
  55. internal, external, batch, EXE or COM file. (NOTE: SEE TSR LIMITATION
  56. BELOW.)
  57.  
  58. /A - add a command
  59.  
  60. Adds a COM file to the XEQ library. The filename given must either
  61. have no extension or .COM and the name part can contain standard DOS
  62. wildcards. A drive and/or path may be given to the target file.
  63. If the file is already in the library it will not be added. A warning
  64. message is given in this eventuality. Similarly if there is
  65. insufficient room to add a file, the addition of this file will be
  66. skipped with a warning. When wildcards exist, XEQ will attempt to add
  67. all files even if a given file cannot be found or is too big. Any attempt
  68. to add the current XEQ.COM file to itself (even if renamed under
  69. DOS3.x) will be prevented. (In DOS 2.x this safety feature can be
  70. thwarted by renaming XEQ.COM. A file called XEQ.COM is the only one
  71. excluded from being added.)
  72.  
  73. /D - delete a command
  74.  
  75. Removes the named command from the library. The filename given must either
  76. have no extension or .COM and the name part can contain standard DOS
  77. wildcards. A prompt asks for confirmation of the delete. 'Y' will
  78. delete the command, 'N' will skip deleting the command, 'G' will GO
  79. and delete this command and all further matching ones without asking
  80. again and 'A' will abort the entire delete process. Obviously 'G' is final
  81. and cannot be aborted once selected. Abort will cancel the effect of
  82. any 'Y' answers previously, AND NO COMMANDS WILL HAVE BEEN DELETED.
  83.  
  84. /E - extract a COM file
  85.  
  86. When the /E switch is used to extract a COM file, a full path for the
  87. resulting file may be specified. If the file already exists at that location,
  88. extraction does not occur. The filename given must either
  89. have no extension or .COM and the name part can contain standard DOS
  90. wildcards. The extracted file has the same date stamp as the COM file it was
  91. originally stored from. The file is NOT deleted from the library.
  92.  
  93. /L - list the library files
  94.  
  95. Displays a list of all files stored in XEQ. The original time and
  96. date stamp are displayed along with the file's byte size. At the end
  97. of the list the remaining space in XEQ is displayed, along with an
  98. indication of how much space has been saved by using XEQ (and
  99. deleting the original COM files). This computation is based upon
  100. the following:
  101.  
  102. DOS 2.x
  103. The value is the difference between the total clusters used by
  104. XEQ.COM on the default drive and the sum of all the clusters which
  105. would have been used on the default drive if each command was in its
  106. own COM file.
  107. The results can be misleading if say, you run XEQ/L while
  108. the drive default points to a floppy with a cluster size of 1024, but
  109. the DOS path executed XEQ.COM from the harddisk with a different
  110. cluster size. In this case the savings indicated are the bytes saved
  111. IF XEQ.COM WAS LOCATED ON THE DEFAULT DRIVE.
  112.  
  113. DOS 3.x
  114. The value is as above, but uses the cluster size of the drive it
  115. found XEQ.COM on and assumes that the COM files would have been on
  116. that drive if they were in separate files.
  117. Under DOS 3.x the savings always relate to the drive the path found
  118. XEQ.COM on and is independent of the default drive cluster size.
  119.  
  120. /H - Display the help screen
  121.  
  122. NO ARGUMENTS
  123. XEQ will try to find internal command AUTOXEQ.COM and if found will
  124. execute it. This can be any COM file so named. Arguments can be supplied
  125. using the /P command. If no such internal file exists, then HELP is
  126. displayed.
  127.  
  128. This feature can make XEQ perform a certain action if no arguments
  129. are supplied to it.
  130.  
  131. /P Run AUTOXEQ with parameters
  132. This performs as with NO ARGUMENTS above, but also passes the given
  133. parameters to the AUTOXEQ internal program. For example, if LIST.COM
  134. was stored in XEQ.COM as AUTOXEQ, then XEQ /PXEQ.DOC will start
  135. LIST.COM and pass it the file name XEQ.DOC.
  136.  
  137. /C Run the command but do not reprocess the command line
  138. Normally when XEQ is run without the /C switch, both the command line
  139. is reprocessed and the final program name is inserted for PMAP etc.
  140. (see below). When the /C switch is present, the original command line
  141. from the DOS prompt is passed to the final program and the program
  142. name returned by the program as argument 0 is the original XEQ name.
  143. For example:
  144.  
  145. If the DOS line is:
  146.  
  147. C> XEQ pgm arg1
  148.  
  149. then <pgm> sees only 1 argument <arg1> and the internally stored
  150. program name is <pgm>. If <pgm> was in C, argv[0] = pgm and argv[1] =
  151. arg1.
  152.  
  153. If the DOS line is:
  154.  
  155. C> XEQ /C pgm arg1
  156.  
  157. then <pgm> sees 3 arguments </C> <pgm> and <arg1> and the internally
  158. stored program name is <XEQ>. If <pgm> was in C, argv[0]=XEQ,
  159. argv[1]=/C, argv[2]=pgm and argv[3]=arg1.
  160.  
  161. The primary purpose of the /C switch is to allow programs resident in
  162. XEQ to ascertain where they originally came from, when this is desirable.
  163.  
  164. Note that is not possible to use the /C in conjunction with the
  165. AUTOXEQ function unless AUTOXEQ is specifically called out on the
  166. command line.
  167.  
  168. LIMITATIONS
  169.  
  170.     As a COM file can only be 64K long, COM files cannot
  171. be added to XEQ if this figure would be violated, as XEQ is a COM file
  172. itself. The /L command indicates the amount of space left and any
  173. attempt to add a file which would exceed the 64k limit is prevented. Any
  174. number of COM files can be added until this number is reached.
  175.         When a command is added or deleted from XEQ, a new copy of XEQ must
  176. be rewritten to disk. How it is written back depends on the version of DOS
  177. you are running.
  178.  
  179. DOS 2.x users
  180.  
  181. The revised library is always written to the current drive and directory as
  182. XEQ.COM, regardless of where the original copy of XEQ was found
  183. (it may have been loaded from elsewhere because of DOS's path
  184. capability). Therefore to update the original copy of XEQ, the /D or /A
  185. commands should be performed in the drive and directory of the
  186. original. If not, then the original copy of XEQ will still exist in its
  187. original location and the updated version in the current drive and
  188. directory. The new version of XEQ will always be called XEQ.COM, regardless
  189. of whether the original program was called XEQ.COM or not.
  190.  
  191. DOS3.x users
  192.  
  193. The revised library will be written over the original using the original's
  194. name. Thus doing a proper update of the original. The library can be given
  195. any name and this will be retained during the updating.
  196.  
  197. MULTIPLE LIBRARIES
  198.  
  199. For DOS 2.x user it is recommended that only one library XEQ.COM exist on the
  200. system. As adding or deleting from a renamed library file results in
  201. the new copy being called XEQ.COM on the current drive, care would
  202. have to be taken to prevent the overwriting of a legitimate XEQ.COM,
  203. and the new XEQ.COM would have to be renamed to the original name of
  204. the revised library.
  205.  
  206. For DOS 3.x users multiple libraries are more feasible as the updated library
  207. is always the original file no matter what it was called or where it
  208. was located. Thus maintaining multiple libraries is much simpler. CED
  209. (see below) can be used to avoid the need to remember which library
  210. contains a given command.
  211.  
  212. TERMINATE & STAY RESIDENT PROGRAMS
  213.  
  214. TSR programs can be stored inside XEQ and will install just like the
  215. original program. HOWEVER, NEVER RUN A TSR PROGRAM THROUGH XEQ WHICH
  216. IS NOT STORED IN XEQ. When XEQ cannot find a program it passes the name to
  217. DOS to run in a shell. If this program is a TSR it will freeze more
  218. memory than needed. XEQ has no way of knowing if a program it is
  219. about to execute externally is a TSR.
  220.  
  221. Beginning with version 1.10, XEQ will put the name of the file being
  222. run into the space between the end of the environment table and the
  223. start of the program. This is where DOS 3.x puts the running program
  224. name and XEQ will only duplicate this when running under DOS3.x. The
  225. purpose of this is to allow the running program to know its own name
  226. and to let TSR memory map programs like MAP.COM and MAPMEM.COM show
  227. the real program name which is resident.
  228.  
  229. A limitation exists for this however. The name stored is of the form
  230. d:\path\filename.COM. The space available to store this string cannot
  231. be increased and is set by the original running of XEQ. So if XEQ is
  232. the name of the comm library, the name of the actual program stored
  233. can only use the first 3 letters, truncating the full name. If this
  234. is important to you, the solution is to rename the library to a
  235. filename of 8 letters.  This will ensure sufficient space for any
  236. revision to any other name.  Starting with version 1.3 this is the
  237. mode of operation. Earlier versions destroyed the path information
  238. and this gave trouble to programs expecting to be able to recover the
  239. full drive, path and name information from argv[0] (in C) or %0 (in
  240. compiled batch files).
  241.  
  242. Starting with version 1.30, the final program name is also correctly
  243. set for such memory mapping programs as PMAP.
  244.  
  245. USAGE TIP
  246.  
  247. The CED utility and its synonym feature can make the use of XEQ
  248. transparent in use. For example, if BEEP.COM is stored inside XEQ then a 
  249. synonym like
  250.     SYN BEEP XEQ BEEP
  251. will cause BEEP to be run out of the XEQ file just by entering BEEP.
  252.  
  253. DISCLAIMER
  254.  
  255.     Hardwood Software Associates guarantees XEQ.COM will do NOTHING
  256. useful at all. You use it at your own risk (make backups of the COM files
  257. stored within XEQ before deleting them from your hard disk). However, it
  258. seems to perform as described here and may be of use to you.
  259.  
  260.     Colin J. Stearman [71036,256]
  261.     Senior Associate
  262.     HS Associates
  263.     143 Ash Street
  264.     Hopkinton, MA 01748
  265.  
  266. ======================================================================
  267.             EDIT LOG
  268.     REV    DATE        NAME        DETAIL
  269.     1.01    14-MAR-87    C.STEARMAN    Fixed bug if COM file name
  270.                         is one character
  271.     1.02    27-MAR-87       C.STEARMAN    Aligned file size column
  272.                         Added disk bytes saved calc
  273.     1.03    1-APR-87        C.STEARMAN      Fixed bug if in list if file
  274.                         was longer than 9999 bytes.
  275.                         Fixed error in saved space
  276.                         computation
  277.     1.10    2-APR-87    C.STEARMAN    Under DOS 3.x updating writes
  278.                         to original file. Also updates
  279.                         command name in environment 
  280.                         for MAP, added wildcard,
  281.                         fixed yet another space
  282.                         computation bug, used local
  283.                         stack for external run only
  284.     1.11   13-APR-87        C.STEARMAN    Revised space saved compute,
  285.                         see note above
  286.     1.12   16-APR-87        C.STEARMAN      Fixed bug in load_run module
  287.                         which did not initialize stack
  288.                         correctly. Bug manifested it-
  289.                         self when MODE was run
  290.                         internally. Returned bad
  291.                         parameters message
  292.         1.13   22-APR-87       C.STEARMAN       Fixed wrong message of file
  293.                         not found in /A
  294.                         Improved construction of PSP
  295.                         when running internals. May
  296.                         clean up some compatability
  297.                         problems. Fixed drive validity
  298.                         test. If wild cards in argu-
  299.                         ments, did not set AX correct-
  300.                         ly per DOS loaded.
  301.     1.14  29-APR-87       C.STEARMAN        Fixed bug when executing ext-
  302.                         ernal commands. Local stack
  303.                         trashed passed command string.
  304.                         Also stack crash caused by
  305.                         allowing XEQ.COM to grow to
  306.                         large. Caused random crashes.
  307.                         Added confirm delete
  308.     1.15 30-MAY-87          C.STEARMAN    Cleaned up help screen and
  309.                         identified which library file
  310.                         was accessed. Fixed bug in
  311.                         extract where a 1 character
  312.                         filename did not have .COM
  313.                         added to it.
  314.     1.20 15-MAR-91          C.STEARMAN    Added /H and the search for 
  315.                         internal command AUTOXEQ.COM
  316.     1.21 24-MAR-91          C.STEARMAN    Added /P for parameters to
  317.                         AUTOXEQ.COM
  318.     1.30 24-APR-91          C.STEARMAN    Modified storage method for
  319.                         program name to include path,
  320.                         added program name for PMAP
  321.     1.31 24-APR-91          C.STEARMAN    Added the /C switch
  322. ======================================================================
  323. *
  324.